home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / helicopter.swf / scripts / frame_5 / PlaceObject2_50_19 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2006-06-13  |  1.7 KB  |  68 lines

  1. onClipEvent(enterFrame){
  2.    if(broken != true)
  3.    {
  4.       scrollSpeed = this._x / _root.mainGround.ground._width * maxScrollSpeed + 2;
  5.       if(fly == true && crashed != true)
  6.       {
  7.          yspeed -= 2;
  8.          gravity = 1.25;
  9.          scrollStart = true;
  10.          this._rotation = -5;
  11.       }
  12.       if(fly == false)
  13.       {
  14.          this._rotation = 1;
  15.       }
  16.       if(scrollStart == true)
  17.       {
  18.          _root.trail.duplicateMovieClip("trail" + depthCounter,depthCounter);
  19.          _root["trail" + depthCounter]._visible = true;
  20.          _root["trail" + depthCounter]._y = this._y;
  21.          depthCounter++;
  22.          if(depthCounter >= 99)
  23.          {
  24.             depthCounter = 1;
  25.          }
  26.       }
  27.       yspeed += gravity;
  28.       yspeed *= friction;
  29.       if(_Y + yspeed + _height / 2 >= _root.wall1._y)
  30.       {
  31.          _Y = _root.wall1._y - _height / 2;
  32.          broken = true;
  33.          yspeed = 0;
  34.          gravity = 0;
  35.          scrollStart = false;
  36.          this.gotoAndPlay("floor");
  37.       }
  38.       else if(_root.wall3._y >= _Y + yspeed - _height / 2)
  39.       {
  40.          _Y = _root.wall3._y + _height / 2;
  41.          yspeed = - yspeed;
  42.       }
  43.       else
  44.       {
  45.          _Y = _Y + yspeed;
  46.       }
  47.       if(_X + xspeed + _width / 2 >= _root.wall2._x)
  48.       {
  49.          _X = _root.wall2._x - _width / 2;
  50.          xspeed = - xspeed;
  51.       }
  52.       else if(_root.wall4._x >= _X + xspeed - _width / 2)
  53.       {
  54.          _X = _root.wall4._x + _width / 2;
  55.          xspeed = - xspeed;
  56.       }
  57.       else
  58.       {
  59.          _X = _X + xspeed;
  60.       }
  61.       xspeed *= friction;
  62.    }
  63.    if(_root.restart == true)
  64.    {
  65.       this.removeMovieClip();
  66.    }
  67. }
  68.